﻿@using QqhrCitizen.Models
@{
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
    Viewpager viwepaher = ViewBag.ViwepaherShow;
    ViewBag.Title = viwepaher.Title;
}

<div>
    <div class="result-title">
        <h1 class="head-tietle">@viwepaher.Title - 轮播修改</h1>
    </div>
    @using (Html.BeginForm("ViwepagerkEdit", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
        @Html.AntiForgeryToken()
        <input value="@viwepaher.ID" type="hidden" name="ID" />
        <table class="detail-table">
            <tr>
                <td class="row-title">标题</td>
                <td>
                    <input class="textbox w-3" value="@viwepaher.Title" name="Title">
                </td>
            </tr>
            <tr>
                <td class="row-title">描述</td>
                <td>
                    <input class="textbox w-3" value="@viwepaher.Subtitle" name="Subtitle">
                </td>
            </tr>
            <tr>
                <td class="row-title">Url</td>
                <td>
                    <input class="textbox w-3" value="@viwepaher.Url" name="Url">
                </td>
            </tr>
            <tr>
                <td class="row-title">优先级</td>
                <td>
                    <input class="textbox w-3" value="@viwepaher.Priority" name="Priority">
                </td>
            </tr>
            <tr>
                <td class="row-title">背景色</td>
                <td>
                    <input id='colorpicker' />
                    <input name="BgColor" id="bgcolor" type="hidden" value="@viwepaher.BgColor" />
                </td>
            </tr>
            <tr>
                <td class="row-title">图片</td>
                <td>
                    <input type="file" name="file" id="file" class="textbox nullable" /> （不修改请留空）
                </td>
            </tr>
        </table>

        <p><input type="submit" value="保存" class="button blue" /></p>
    }
</div>


<script>
    $("#colorpicker").spectrum({
        color: "#f00",
        clickoutFiresChange: true,
        change: function (color) {
            $("#bgcolor").val(color.toHexString()); // #ff0000
        }
    });
</script>